package utils.test.img;

import java.io.File;
import java.io.IOException;

import lion.dev.image.ImageJ;

/**
 * @author lion
 * @date 2016年9月13日
 */
public class T {

	public static void main(String[] args) throws IOException {

		ImageJ imageJ = new ImageJ(new File("D:/2.jpg"));

		// ImageJ imageJ = new ImageJ(new File("D:/d.jpg"));
		// // imageJ.write(new FileOutputStream("D:/500.jpg"));
		// BufferedImage result = imageJ.resizeWidth(500).getImage();
		//
		// BufferedImage image = ImageIO.read(new File("D:/d.jpg"));
		// ImageReader ir = ImageIO.getImageReadersByFormatName("jpeg").next();
		// ir.setInput(ImageIO.createImageInputStream(new File("D:/d.jpg")),
		// true);
		// ImageWriter writer = ImageIO.getImageWriter(ir);
		// IIOMetadata meta = ir.getImageMetadata(0);
		// writer.setOutput(ImageIO.createImageOutputStream(new
		// FileOutputStream("D:/500.jpg")));
		//
		// int width = 492;
		// int height = 346;
		// BufferedImage img = new BufferedImage(width, height,
		// image.getType());
		// Graphics2D g = img.createGraphics();
		// g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
		// RenderingHints.VALUE_ANTIALIAS_ON);
		// g.setRenderingHint(RenderingHints.KEY_RENDERING,
		// RenderingHints.VALUE_RENDER_QUALITY);
		// g.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
		// RenderingHints.VALUE_INTERPOLATION_BILINEAR);

		// g.drawImage(image.getScaledInstance(width, height,
		// Image.SCALE_SMOOTH), 0, 0, null);
		// g.dispose();
		//
		// writer.write(new IIOImage(img, null, meta));

	}
}
